<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var obj = Object.defineProperties({},{
            name:{
                // value:"啦啦啦"
                // writable:true
                get:function(){
                    // console.log("执行了");
                    // js
                    // console.log('get',this);
                    // return "啦啦啦"
                    return '《'+this.a+'》';
                },
                set:function(val){
                    // console.log("执行了1",val);
                    // console.log('set',this);
                    this.a = val;
                }
            }
        })

        // console.log(obj);

        obj.name = '水浒传';

        console.log(obj.name);

        console.log(obj);



        // 获取name
        // obj.name

    </script>
</body>
</html>